package JPanelGradient;



import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;
import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.LinearGradientPaint;
import java.awt.Rectangle;

public class Estilos extends javax.swing.JPanel {

	private Color color1;// = new Color(0x88588);
	private Color color2;// = new Color(0x55555);
    private float x1=0;
    private float y1=0;
    private float x2=getWidth();
    private float y2=getHeight();
	private int tema;
    public int getTema() {
		return tema;
	}

	public void setTema(int tema) {
		this.tema = tema;
	}

	public Estilos(int tema) {
		super();
		//this.color1 = color1;
		//this.color2 = color2;
		this.tema = tema;
	    	if(tema == 1){
	    		 color1 = new Color(0x88588);
	    		 color2 = new Color(0x55555);
	    	}
	    	else
	    		if (tema == 2){
	    		 color1 = new Color(0x55555555);
	    		 color2 = new Color(0x9999);
	    	}
	    	else
	    	{
	    		 color1 = new Color(0x99999990);
	    		 color2 = new Color(0x5999);
	    	}
	    		
	 
	}

	public Estilos() {
    }
    
   public void Temas(){
    	if(tema == 1){
    		Color color1 = new Color(0x88588);
    		Color color2 = new Color(0x55555);
    	}
    	else
    		if (tema == 2){
    		Color color1 = new Color(0x55555555);
    		Color color2 = new Color(0x9999);
    	}
    	else
    	{
    		Color color1 = new Color(0x99999990);
    		Color color2 = new Color(0x5999);
    	}
    		
    }
    
	/**
	* Auto-generated main method to display this JFrame
	*/
	 protected void paintComponent(Graphics g) {
	        Graphics2D g2 = (Graphics2D) g.create();

	        Rectangle clip = g2.getClipBounds();
	        float x=getWidth();
	        float y=getHeight();
	        g2.setPaint(new GradientPaint(0.0f, 0.0f, color1.brighter(),
	                0.0f, getHeight(), color2.brighter()));
	        g2.fillRect(clip.x, clip.y, clip.width, clip.height);
	    }
	 
	 public Color getColor1() {
	        return color1;
	    }

	    public void setColor1(Color color1) {
	        this.color1 = color1;
	    }

	    public Color getColor2() {
	        return color2;
	    }

	    public void setColor2(Color color2) {
	        this.color2 = color2;
	    }
	    /*public static void main(String[] args) {
			SwingUtilities.invokeLater(new Runnable() {
				public void run() {
					Estilos inst = new Estilos();
					inst.setLocation(null);
					inst.setVisible(true);
				}
			});
		}*/

	}
